package com.xr.hr.care;

import com.xr.common.CommUtil;
import com.bstek.dorado.common.*;
import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.DBStatement;
import com.bstek.dorado.view.*;
import com.bstek.dorado.view.data.*;
import com.bstek.dorado.view.control.*;

/**
 * batchCareAddViewModel
 */
public class batchCareAddViewModel extends DefaultViewModel {
  protected void doUpdateData(ParameterSet parameters, ParameterSet outParameters)
      throws Exception {
    // Add your code here
    super.doUpdateData(parameters, outParameters);
  }
  
  public void batchCareAdd(ParameterSet parameters, ParameterSet outParameters)
  throws Exception { 
	  
		DBStatement dbs = new DBStatement();
		Dataset dsCare = getDataset("datasetCare");
		//dsWc.getField("CLASS_TYPE").setProperty("noupdate");
		
		CommUtil.dbsUpdateData(dbs, dsCare, "emp_care", "emp_care_id", "seq_emp_care");
		
		
		RecordIterator ri = dsCare.recordIterator();
		ri.setVisibility(Dataset.FILTER_DELETED);
		while (ri.hasNext()) {
		  Record record = ri.nextRecord();
		  CommUtil.executeUpdate(dbs, "delete from emp_care where emp_care_id="+record.getString("emp_care_id"));
		}
		
		
		dbs.close();
   }
  
}
